package androidgame.teslawars.game;

public abstract class Tile {
	
	public enum Terrain {
		FOREST, MOUNTAIN, PLAIN
	}

	int x;
	int y;
	int defenseRating;
	Terrain terrain;
	Unit unit;
	boolean isHighlighted;
	
	// Takes an xIndex, yIndex and the type of terrain that the tile is.
	public Tile (int xIndex, int yIndex) {		
		this.x = xIndex;
		this.y = yIndex;
		isHighlighted = false;
		unit = null;
	}
	
	
	@Override 
	public String toString() {
		StringBuilder builder = new StringBuilder();
		
		builder.append(terrain.toString());
		builder.append(": ");
		builder.append("Location =");
		builder.append(x);
		builder.append(",");
		builder.append(y);
		builder.append(" Defense Rating =");
		builder.append(defenseRating);
		builder.append(" Unit =");
		builder.append(unit.unitName.toString());
		builder.append(" Highlight =");
		builder.append(isHighlighted);
		
		return builder.toString();		
	}


	public int getX() {
		return x;
	}


	public int getY() {
		return y;
	}


	public int getDefenseRating() {
		return defenseRating;
	}


	public Terrain getTerrain() {
		return terrain;
	}


	public Unit getUnit() {
		return unit;
	}


	public boolean isHighlighted() {
		return isHighlighted;
	}	
	
	
}
